﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonsterEngine.Interfaces;
using MonsterEngine.Managers;

namespace MonsterEngine.Augments
{
    public class HealOverTime:IAugmentable
    {
        public event WornOffHandler WornOff;
        private int _effectiveTurnCount = 4;
        public int EffectiveTurnCount
        {
            get{return _effectiveTurnCount;}
        }
        private int _currentTurnCount;
        public int CurrentTurnCount
        {
            get { return _currentTurnCount; }
            set { _currentTurnCount = value; }
        }
        private int _basePoint = 0;

        public HealOverTime(int basePoint)
        {
            this._basePoint = basePoint;
        }
        public void ExecuteAugment()
        {
            if (_currentTurnCount == _effectiveTurnCount)
            {
                PlayerManager.Player1.BuffList.Remove(this);
                if (WornOff != null)
                {
                    WornOff();
                }
                _currentTurnCount = 0;
                return;
            }
            else
            {
                int healVal = PlayerManager.Player1.SpellPower + _basePoint;
                PlayerManager.Player1.HitPoints += healVal;
                Console.WriteLine("{0} has been healed for {1}", PlayerManager.Player1.Name, healVal);
                _currentTurnCount++;
            }
        }
    }
}
